<?php

/**
 * E_ALL : 开发调试
 * E_ALL ^ E_NOTICE : 生产环境
 */
error_reporting(E_ALL);

/**
 * 基础路径
 */
define('BASE_PATH'  ,  strtr(dirname(__FILE__) . '/' , '\\' , '/'));
define('BASE_URI' , '/');


/**
 * 时区、时间
 */
date_default_timezone_set('Asia/Chongqing');
define('NOW' , time());


/**
 * 客户端IP
 */
if (isset($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"])){
	$ip = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
}elseif (isset($HTTP_SERVER_VARS["HTTP_CLIENT_IP"])){
	$ip = $HTTP_SERVER_VARS["HTTP_CLIENT_IP"];
}elseif (isset($HTTP_SERVER_VARS["REMOTE_ADDR"])){
	$ip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
}elseif (getenv("HTTP_X_FORWARDED_FOR")){
	$ip = getenv("HTTP_X_FORWARDED_FOR");
}elseif (getenv("HTTP_CLIENT_IP")){
	$ip = getenv("HTTP_CLIENT_IP");
}elseif (getenv("REMOTE_ADDR")) {
	$ip = getenv("REMOTE_ADDR");
}else {
	$ip = "Unknown";
}
define('IP' , $ip);
unset($ip);



/**
 * 常规配置
 */
require(BASE_PATH . 'config/comm.config.php');



/**
 * 核心类
 */
require(BASE_PATH . 'core/core.class.php');
?>